#define _CRT_SECURE_NO_WARNINGS 1
#include "list.h"

void test1()
{
	LTNode* plist = NULL;
	plist = LTInit();

	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);

	LTPrint(plist);

	LTPopBack(plist);
	LTPrint(plist);

	LTPopBack(plist);
	LTPopBack(plist);
	LTPopBack(plist);
	LTPopBack(plist);
	LTPrint(plist);
}
void test2()
{
	LTNode* plist = NULL;
	plist = LTInit();

	LTPushFront(plist, 1);
	LTPushFront(plist, 2);
	LTPushFront(plist, 3);
	LTPushFront(plist, 4);
	LTPushFront(plist, 5);

	LTPrint(plist);

	LTPopFront(plist);
	LTPrint(plist);

	LTPopFront(plist);
	LTPopFront(plist);
	LTPopFront(plist);
	LTPopFront(plist);
	LTPrint(plist);

}

void test3()
{
	LTNode* plist = NULL;
	int size = 0;
	plist = LTInit();

	LTPushFront(plist, 1);
	LTPushFront(plist, 2);
	LTPushFront(plist, 3);
	LTPushFront(plist, 4);
	LTPushFront(plist, 5);

	size = LTSize(plist);
	LTPrint(plist);
	printf("%d\n", size);
}

void test4()
{
	LTNode* plist = NULL;
	plist = LTInit();

	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);

	int x;
	scanf("%d", &x);
	LTNode* pos = LTFind(plist, x);

	if (pos)
	{
		LTInsert(pos, x * 10);
	}
	LTPrint(plist);
}
void test5()
{
	LTNode* plist = NULL;
	plist = LTInit();

	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);

	int x;
	scanf("%d", &x);
	LTNode* pos = LTFind(plist, x);

	if (pos)
	{
		LTErase(pos);
	}
	LTPrint(plist);
}

void test6()
{
	LTNode* plist = NULL;
	plist = LTInit();

	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);
	LTPrint(plist);
	LTDestroy(plist);
	plist = NULL;
}

int main()
{
	test6();
	return 0;
}